package com.czy.fx.fxml;

import javafx.fxml.FXML;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.AnchorPane;
import javafx.scene.web.WebView;
import javafx.stage.Stage;

public class Demo1Controller {

    @FXML
    private Button button;

    public Label label;
    public AnchorPane anchorPane;

    public void initialize() {
        label.setText("Hello World");
        button.setOnAction(event -> {
            System.out.println("????");
        });

    }

    public void action(){
        System.out.println("点击");
        anchorPane.getScene().getWindow().hide();

        WebView webView = new WebView();
        webView.getEngine().load("http://192.168.100.111:8089/system/login/toLogin.do");
        webView.setPrefHeight(1000);
        webView.setPrefWidth(1800);
        AnchorPane pane = new AnchorPane();
        pane.setPrefWidth(1800);
        pane.setPrefHeight(1000);
        pane.getChildren().add(webView);
        Stage stage = new Stage();
        Scene scene = new Scene(pane);
        stage.setScene(scene);
        stage.show();
    }

    public void click1(){
        System.out.println("点击图片");

    }
}
